home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / keyutil.doc < prev    next >
Internet Message Format  |  1995-03-31  |  6KB

  1. Date: January 10, 1992 
  2.  
  3. KEYUTIL - Directory 
  4. Copyright 1992  Brian Maguire 
  5. All Rights Reserved 
  6.  
  7. DISCLAIMERS 
  8.  
  9. KEYUTIL and this manual are presented without warranties, 
  10. expressed or implied.  The author makes no guarantee as to the 
  11. fitness of this software. 
  12.  
  13. KEYUTIL can be copied freely provided the software, including 
  14. this manual, is copied in its entirety.  The user cannot be 
  15. charged, in whole or in part, except for the cost of 
  16. reproduction.  No part of this package may be used for commercial 
  17. purposes without written permission from the author. 
  18.  
  19. SUMMARY 
  20.  
  21. KEYUTIL contains a number of useful functions that gives the 
  22. programmer easier control over the keyboard.  Several of these 
  23. programs are intended for system RPL programs and do not include 
  24. the proper error checking, but can be used in a user RPL with 
  25. extreme caution. 
  26.  
  27. COMMANDS 
  28.  
  29. KRPTP 
  30.  
  31. Input:  Any object 
  32.  
  33. KRPTP accepts any object as input, but expects an executable 
  34. object (program, code, etc.) that neither removes or pushes any 
  35. object on the stack.  KRPTP evaluates the object input on level 
  36. one and scans the keyboard.  If the last key that was processed 
  37. is still pressed down, the program pauses, and the repeatedly 
  38. evaluated the input object until the key is released.  This 
  39. program has an advantage over the system RPL command REPEATER in 
  40. that the repeat key does not need to included as an argument. 
  41. Instead, it is recalled from the key buffer. 
  42.  
  43. KRPT 
  44.  
  45. Input:  Any object 
  46.  
  47. KRPT functions exactly like KRPTP except it does not pause 
  48. between the first evaluation and the repeated evaluation of the 
  49. input object. 
  50.  
  51. KEYSTATE 
  52.  
  53. Input:     None 
  54. Output:    If a key is pressed       -   Keycode,  Real(0 or 1), 1 
  55.            If a key is not pressed   -  0 
  56.  
  57. If a key is pressed, KEYSTATE will return the key's 
  58. keycode(rowcol.shift), a flag indicating whether the key was just 
  59. pressed or is being held down, and the real number 1.  If a key 
  60. is not being pressed the real number 0 is returned.  If a key is 
  61. pressed the real number on level two will equal 1 if it is a new 
  62. key stroke or 0 if it is a key that is being held down. 
  63.  
  64. ->KA 
  65.  
  66. Input:   A list in the form { obj, keycode ....... obj , keycode } 
  67. Output:  Hex string, list 
  68.  
  69. ->KA formats a list containing key assignments to be used by the 
  70. program GETKASN listed later  It converts a list of object and 
  71. keycode into a hex string and a list of objects.  The input list 
  72. must resemble the list returned by RCLKEYS.  It should contain 
  73. pairs of objects and keycodes.  The hex string contains the key 
  74. code information and the offset to each key's associated object. 
  75. The list is the set of all key assignments. 
  76.  
  77. KA-> 
  78.  
  79. Input :  hex string, list 
  80. Output:  A list in the form { obj keycode ..... obj keycode } 
  81.  
  82. KA-> converts a hex string containing key assignment offsets and 
  83. a list of key objects back into a single list of key assignments. 
  84.  
  85. GETKASN 
  86.  
  87. Input:  system binary, system binary, hex string, list 
  88. Output  If key is found      -   key object, TRUE 
  89.         If key is not found  -  FALSE 
  90.  
  91. This program is intended to be used in a system RPL program.  It 
  92. accepts a key number and shift plane on levels four and three, a 
  93. hex string containing key data and the offset to the key object 
  94. on level two, and a list of key assignments on level one.  The 
  95. arguments on level one and two must be create using the program - 
  96. KA. 
  97.  
  98. RASN 
  99.  
  100. Input     the variables KLNK and KASN 
  101. Output:   temporarily reassigns selected keys 
  102.  
  103. RASN is an example program that demonstrates the usefulness of 
  104. GETKASN.  The key that you want to reassign must first be created 
  105. using ->KA.  the list of key object must them be stored in KASN 
  106. while the hex string representing the offsets must be stored in 
  107. KLNK.  Running RASN after the key definitions have been stored in 
  108. KASN and KLNK will set temporarily reassign the selected keys. 
  109. Running RASN will the keys are reassigned will restored the 
  110. normal keyboard. 
  111.  
  112. ->KEYMAP 
  113.  
  114. Input:   List containing 294 key objects 
  115. Output:  Hex string 
  116.  
  117. This program creates a hex string that contains the offsets for a 
  118. list of 294 key object,.  This hex string, along with a list of 
  119. key objects are used by GETKMAP to redefine the entire keyboard. 
  120.  
  121. GETKMAP 
  122.  
  123. Input:    system binary, system binary, hex string, list 
  124. Output:   key object 
  125.  
  126. This program is intended to be used in a system RPL program. 
  127. When redefining the entire keyboard GETKMAP has less overhead 
  128. than  GETKASN.  It expects a key number and shift plane on levels 
  129. four and three, a hex string on level two, and a list of 294 key 
  130. objects on level one.  The proper key object is returned to level 
  131. one.  NOTE: the hex string input on level two must be created 
  132. using ->KEYMAP. 
  133.  
  134. RMAP 
  135.  
  136. Input:  the hex string stored in KYOFST and the list stored in KYOBS 
  137. Output: the entire keyboard is redefined 
  138.  
  139. RMAP is an example of how GETMAP can be used.  First, you must 
  140. create a list of 294 objects representing the keyboard.  The 
  141. first 49 object are assigned to the keys with a shift state of 1, 
  142. the next 49 object for keys with a shift state of 2, and so on. 
  143. This list must then be stored in KEYOBS.  Next, recall the list 
  144. and calculate the offsets to each key object using the program - 
  145. >KEYMAP.  The resultant hex string must be stored in KYOFST. 
  146. Finally, running RMAP will redefine the keyboard.  Running RMAP 
  147. while the keyboard is redefined will restore the standard key 
  148. definitions. 
  149.  
  150. NOTE! If a key object list is used by any of these programs 
  151. contain global names which are later converted into XLIB names 
  152. with the USRLIB the key object offsets that were calculated with 
  153. ->KA or ->KEYMAP will be incorrect and will cause you program to 
  154. crash.  To correct this problem you must recall the key object 
  155. list from the library version using the HACKIT or the SRPL 
  156. library, calculate new key object offsets, and then store them 
  157. into the original directory version.  Now you can send the 
  158. directory to a PC and convert it into a library using USRLIB 
  159. again.  This new version should work fine. 
  160.  
  161. Enjoy, 
  162.  
  163. Brian Maguire 
  164. 139 Kingsbury 
  165. Dearborn, MI 48128 
  166.